<?php

namespace app\common\service;

use app\common\model\PaymentAccount;
use app\common\constants\AdminConstant;
use EasyAdmin\tool\CommonTool;
use payment\leisenpay\leisenpay;

/**
 * 权限验证服务
 * Class AuthService
 * @package app\common\service
 */
class TransferService
{

    public static function dopay($item,$mode='leisenpay',$type='2')
    {

         $payment = (new PaymentAccount())->getItem(['alias'=>$mode]);

         $service=new leisenpay($payment);
         $transfer=[
             'out_trade_no'=>uniqid(),
             'account'=>$item['reward_account'],
             'real_name'=>$item['reward_name'],
             'amount'=>$item['amount'],
             'remark'=>$item['remark'],
             'payee_type'=>$type
         ];
         return $service->transfer($transfer);

    }

}